<template>
	<nt-container>
		<view class="code">
			<view class="code-content">
				<view class="code-image">
					<nt-cdn-image :src="code"></nt-cdn-image>
				</view>
				<view class="code-title">{{ url }}</view>
			</view>
		</view>
	</nt-container>
</template>

<script>
import { getShareCode } from "@/api"
export default {
	data(){
		return {
			code: "",
			url: ""
		}
	},
	onLoad(){
		this.getCode()
	},
	methods: {
		getCode(){
			getShareCode().then(res => {
				const {code, data} = res;
				if(code === 1){
					this.code = data.gzh.images
					this.url = data.gzh.url
				}
			})
		}
	}
}
</script>

<style scoped lang="scss">
.code{
	height: 100vh;
	padding: 30rpx;
	box-sizing: border-box;
	background:#fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	&-image{
		height: 720rpx;
	}
	&-content{
		padding: 20rpx;
		box-sizing: border-box;
		background:#fff;
		box-shadow: 0 0 10rpx rgba(0,0,0,0.2)
	}
	&-title{
		word-break: break-all;
		text-align: center;
		color:#333;
		font-size: 34rpx;
		margin-top: 20rpx;
	}
}
</style>